package service.impl;


import dao.IFlowerDAO;
import model.Flower;
import service.IFlowerService;

import java.util.List;

/**
 * @author wydty
 */
public class FlowerService implements IFlowerService {

    private IFlowerDAO flowerDAO;


    public IFlowerDAO getFlowerDAO() {
        return flowerDAO;
    }


    public void setFlowerDAO(IFlowerDAO flowerDAO) {
        this.flowerDAO = flowerDAO;
    }


    public List getNewFlower() {
        return flowerDAO.getNewFlower();
    }

    public List getFlowerByCatalogidPaging(int catalogid, int currentPage,
                                           int pageSize) {
        return flowerDAO.getFlowerByCatalogidPaging(catalogid, currentPage, pageSize);
    }

    public int getTotalByCatalog(int catalogid) {
        return flowerDAO.getTotalByCatalog(catalogid);
    }

    public Flower getFlowerById(int id) {
        return flowerDAO.getFlowerById(id);
    }

    public boolean addOrUpdateFlower(Flower flower) {
        return flowerDAO.addOrUpdateFlower(flower);
    }

    public List getAllFlower() {
        return flowerDAO.getAllFlower();
    }

    public boolean deleteFlowerById(int id) {
        return flowerDAO.deleteFlowerById(id);
    }
}
